package com.yashi.appController;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("/checkcenter")
public class CheckCenterController {

    //页面请求
    @GetMapping("/socket/{id}")
    public ModelAndView socket(@PathVariable String id) {
        ModelAndView mav=new ModelAndView("allGroupList");
        mav.addObject("id", id);
        return mav;
    }
    //推送数据接口
    @ResponseBody
    @RequestMapping("/socket/push/{cid}")
    public String  pushToWeb(@PathVariable String cid,String message) {  
//        try {
////            WebSocket.sendInfo(message,cid);
//        } catch (IOException e) {
//            e.printStackTrace();
//            return (cid+"#"+e.getMessage());
//        }  
        return message;
    } 
} 